/*
 * @Author: WeijianXu weijian.xu@unidt.com
 * @Date: 2024-04-28 16:20:08
 * @LastEditors: WeijianXu weijian.xu@unidt.com
 * @LastEditTime: 2024-04-30 09:34:12
 * @FilePath: \echarts5-test\src\router\index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { createRouter, createWebHashHistory } from 'vue-router'
import routerViewer from './router-viewer.vue';
// 1. 定义路由组件.

// 2. 定义一些路由
// 每个路由都需要映射到一个组件。
// 我们后面再讨论嵌套路由。
export const sideRoutes = [
  {
    path: '/start', component: routerViewer, redirect: '/start/echart', meta: { title: '入门篇' },
    children: [
    {
      path: 'echart',
      name: 'start-echart',
      component: () => import('@/views/start/echarts.vue'),
      meta: {
        title: '按需加载 ECharts'
      }
    },
    {
      path: 'transition',
      name: 'start-transition',
      component: () => import('@/views/start/transition.vue'),
      meta: {
        title: '动画',
        version: '5.2'
      }
    },
    {
      path: 'high-demisson',
      name: 'start-high-demisson',
      component: () => import('@/views/start/high-demisson.vue'),
      meta: {
        title: '高维度数据',
        version: '5.2'
      }
    },
    {
      path: 'custom-series',
      name: 'start-custom-series',
      component: () => import('@/views/start/custom-series.vue'),
      meta: {
        title: '自定义序列',
        version: '5.2'
      }
    },
    {
      path: 'multi-axis',
      name: 'start-multi-axis',
      component: () => import('@/views/start/multi-axis.vue'),
      meta: {
        title: '多坐标轴',
        version: '5.3'
      }
    },
    {
      path: 'pie-radius',
      name: 'start-pie-radius',
      component: () => import('@/views/start/pie-radius.vue'),
      meta: {
        title: '扇区圆角',
        version: '5.3'
      }
    },
    {
      path: 'gauge-label',
      name: 'start-gauge-label',
      component: () => import('@/views/start/gauge-label.vue'),
      meta: {
        title: '仪表盘标签',
        version: '5.4'
      }
    }
    ]
  },
  {
    path: '/conception', component: routerViewer, meta: { title: '概念篇' },
    children: [
      {
        path: 'event-action',
        name: 'conception-event-action',
        component: () => import('@/views/conception/event-action.vue'),
        meta: {
          title: '事件与行为'
        }
      }
    ]
  },
  {
    path: '/practice', component: routerViewer, meta: { title: '实践篇' },
    children: [
      {
        path: 'bar-waterfall',
        name: 'conception-bar-waterfall',
        component: () => import('@/views/practice/bar-waterfall.vue'),
        meta: {
          title: '柱状阶梯瀑布图'
        }
      }
    ]
  }

];
const routes = [
  { path: '/', redirect: '/start' },
  ...sideRoutes,
]

// 3. 创建路由实例并传递 `routes` 配置
// 你可以在这里输入更多的配置，但我们在这里
// 暂时保持简单
export default createRouter({
  // 4. 内部提供了 history 模式的实现。为了简单起见，我们在这里使用 hash 模式。
  history: createWebHashHistory(),
  routes, // `routes: routes` 的缩写
});

// 5. 创建并挂载根实例

// 现在，应用已经启动了！
